<html>
<head><title>Test results</title>
<script src="../js/json-ref.js"></script>
<script>
var testObj= {
    "name": {"type":"string",
	length:5,
      "required":true},
	  	"final":true,
    "born" : {"id":"bornId",
	"type":["number","string"], //allow for a numeric year, or a full date
      "format":"date", //format when a string value is used
      "minimum":1900, //min/max for when a number value is used
      "maximum":2010
    },
    "gen der" : {"type":"string",
    "options":["male","female"]},
    "address" : {"type":
        {"street":{"type":"string"},
         "city":{"type":"string"},
         "state":{"type":"string"}},
       "format":"address"}
  }
testObj.address.genderRef = testObj['gen der'];
testObj.bornType = testObj.born.type; 
 window.onload = function() {
 	var asString = JSON.stringify(testObj);
	asString = '{"rootRef":{"$ref":"$"},"abornType":{"$ref":"bornId.type"},"name":{"type":"string","length":5,"required":true},"final":true,"born":{"id":"bornId","type":["number","string"],"format":"date","minimum":1900,"maximum":2010},"gen der":{"type":"string","options":["male","female"]},"address":{"type":{"street":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"}},"format":"address","genderRef":{"$ref":"$[\\"gen der\\"]"}}}';
	var recreated = JSON.parse(asString);
	alert(recreated);
}
</script>
<body>
<h2>Test results</h2>


</body></html>
